home *** CD-ROM | disk | FTP | other *** search
- Path: EU.net!sun4nl!xs4all!usenet
- From: martijnl@xs4all.nl (Martijn Lievaart)
- Newsgroups: comp.lang.c++
- Subject: Re: Need help with buttons!
- Date: 7 Jan 1996 00:57:58 GMT
- Organization: XS4ALL, networking for the masses
- Message-ID: <4cn5qm$he7@news.xs4all.nl>
- References: <4ckad5$13pg@news.gate.net>
- NNTP-Posting-Host: mas01-09.dial.xs4all.nl
- X-Newsreader: WinVN 0.99.6
-
- In article <4ckad5$13pg@news.gate.net>, debmcd@isysfla.com says...
- >
- >I am writing a Windows multimedia program in Visual C++...
- >
- >In this program, there is a button that when pressed, will execute functions
- that take some time to complete. While this
- >execution is occuring, I don't want the user to be able to press the button
- again. Does any one know of a way to lock out all
- >mouse clicks until certain commands are finished executing????
- >
- >(I have tried changing to the WAIT icon and disabling, or graying, the button
- as well as the entire window...this does not help.
- >When this was done, all mouse click-messages are sent to the queue and still
- processed when the previous execution is
- >complete.) For example, if the button were to play an audio clip when
- pressed, and the user clicks the mouse over the button
- >again, before the audio clip is finished, the audio clip would play
- again--and I don't want this!
- >
- >Please help!!
- >
- >Thank you!
- >
- >D. McDonough
-
- I once saw a nice trick for this. I would have to look it up to see how it was
- done exactly but I'll give you the gist.When you want to 'eat the mouse input'
- create a transparent childwindow over your window. (You may want to Z-move the
- cancelbutton to be above this window so that stays responsive). I think all
- your controls will have to have the style parent-DC, buildin controls are. Now
- all mouse input goes to this window and never go to the button. Mail me if you
- need more help with this.
-
- As an alternative, eat all messages when you re-enable the button.
-
- BTW, your article contained very long lines. Kinda makes it hard to read.
- Please limit to 80 chars.
-
- Hope this helps,
- Martijn
-
-